package com.cookpan001.display.layer 
{
	import com.cookpan001.data.AppConst;
	import flash.display.Loader;
	import flash.display.LoaderInfo;
	import flash.events.Event;
	import flash.net.URLRequest;
	import flash.system.ApplicationDomain;
	import flash.system.LoaderContext;
	/**
	 * 背景
	 * @author cookpan001
	 */
	public class BackLayer extends AbstractLayer
	{
		
		public function BackLayer() 
		{	
			var url:String = AppConst.__resPath + "back/beijing.png";
			var request:URLRequest = new URLRequest(url);
			var context:LoaderContext = new LoaderContext();
			context.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
			var loader:Loader = new Loader();
			loader.load(request, context);
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.complete, false, 0, true);
		}
		
		private function complete(e:Event):void
		{
			var contentInfo:LoaderInfo = e.target as LoaderInfo;
			this.addChild(contentInfo.loader);
		}
		
	}

}